﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Portal.Nhibernate.Repository;

namespace Portal
{
    public class LinkCache
    {
        public static IList<ILink> GetList()
        {
            IList<ILink> list;
            if (!Cache.TryGet(CacheKey.LinkList, out list))
            {
                var linkRepository = new LinkRepository();
                list = linkRepository.Get().OrderBy(o => o.Sort).ToList();
                Cache.Set(CacheKey.LinkList, list);
            }
            return list;
        }

    }
}
